<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1 id="title">hello,world</h1>
    <button class="btn">1</button>
    <button class="btn">2</button>
    <button class="btn">3</button>
    <script>
        // let h1=document.getElementById("title");
        // h1.innerHTML="你好，世界"
        // console.log(h1.innerHTML)
        //弃用
        // getElementsBy返回值是一个dom节点
        //getElementsByClassName返回值是一个dom节点的集合
        // let btns=document.getElementsByClassName("btn")
        // for(i in btns){
        //     console.log(i)
        //     btns[i].innerHTML="test"
        // }
        // console.log(btns)
        let h1=document.querySelector("#title");
        h1.innerHTML="你好，世界"
        console.log(h1.innerHTML)
        // let btns=document.querySelectorAll(".btn")
        // for(i in btns){
        //     console.log(i)
        //     btns[i].innerHTML="test"
        // }
    </script>
</body>
</html>